/******************************************************************************
@file:  SearchHome.java
@author Ramesh Anandhan

DESCRIPTION
-----------------------------------------------------------------------------
Copyright (c) 2011, GEEKWAVE SOLUTIONS INC.

All rights reserved.
 ******************************************************************************/
package com.smartc.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SearchHome extends Activity implements OnClickListener {

	private Button mMrgSearch = null;
	private Button mEveSearch = null;
	private Button mLMSSearch = null;
	private Button mRouteSearch = null;
	private Button mTimeSearch = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.search_home);
		mMrgSearch = (Button) findViewById(R.id.btn_search_morning);
		mEveSearch = (Button) findViewById(R.id.btn_search_evening);
		mLMSSearch = (Button) findViewById(R.id.btn_search_lms);
		mRouteSearch = (Button) findViewById(R.id.btn_search_route);
		mTimeSearch = (Button) findViewById(R.id.btn_search_time);

		mMrgSearch.setOnClickListener(this);
		mEveSearch.setOnClickListener(this);
		mLMSSearch.setOnClickListener(this);
		mRouteSearch.setOnClickListener(this);
		mTimeSearch.setOnClickListener(this);
	}

	@Override
	public void onClick(View view) {
		int id = view.getId();
		Intent intent = new Intent();
		intent.setClass(this, Search.class);
		switch (id) {
		case R.id.btn_search_morning:
			intent.putExtra("search", "1");
			break;
		case R.id.btn_search_evening:
			intent.putExtra("search", "2");
			break;
		case R.id.btn_search_lms:
			intent.putExtra("search", "3");
			break;
		case R.id.btn_search_route:
			intent.putExtra("search", "route");
			break;
		case R.id.btn_search_time:
			intent.putExtra("search", "time");
			break;
		default:
			return;
		}

		startActivity(intent);
	}
}
